/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication19;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;


public class NewJFrame extends javax.swing.JFrame {
    public NewJFrame() {
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
            private static JLabel lab;
    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        new NewJFrame().setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }//GEN-LAST:event_formWindowClosing
           public void setZegar(java.sql.Time s){
               lab.setText(s.toString());

        }

    public static void main(String args[]) {


        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                JFrame ramk = new JFrame("abc");

                JPanel panel = new JPanel();
                lab = new JLabel();
                panel.add(lab);
                ramk.add(panel);
                Runnable zegar = new Zegar();
                Thread t = new Thread(zegar);
                t.start();
                
                ramk.setLocationRelativeTo(null);
                
                ramk.setSize(350, 350);
                ramk.setVisible(true);
            }
            



        });


    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables


}
